const db = require('../db/db')
module.exports = {
    GETIMGURL: async (ctx, next) => {
        ctx.body = {
            code:200
        }
    },
    GETVIPSEX: async (ctx, next) => {
        const {belongToShop} = ctx.request.query
        let [res] = await db.promise().query('select id from viplist where sex=? and status=0 and belongToShop=?',['男士',belongToShop])
        let [res1] = await db.promise().query('select id from viplist where sex=? and status=0 and belongToShop=?',['女士',belongToShop])
        let [res2] = await db.promise().query('select id from viplist where sex=? and status=0 and belongToShop=?',['保密',belongToShop])
        console.log(res.length,res1.length,res2.length);
        ctx.body = {
            code:200,
            sexData:{
                nan:res.length,
                nv:res1.length,
                no:res2.length,
            }
        }
    },
}